Let's trace the recursive calls. As DFS explores deeper, new frames are pushed onto the call stack. When it backtracks, frames are popped. This table shows the state of the call stack at each key event during the traversal.
| Event | Stack (top is rightmost) |
|---|---|
| Enter A | [A] |
| Enter B | [A,B] |
| Enter D | [A,B,D] |
| Enter E | [A,B,D,E] |
| Enter C | [A,B,D,E,C] |
| Return C | [A,B,D,E] |
| Return E | [A,B,D] |
| Enter F | [A,B,D,F] |
| Return F | [A,B,D] |
| Return D | [A,B] |
| Return B | [A] |
| Return A | [] |